1 <?php
2 session_start();
3 include(
"header.php");
4 include(
"sidebar.php");
5
6 include(
"dbconnection.php");
7
8 $dt= date(
"Y-m-d");
9 if
(isset($_GET["purchaseid"]))
10 {
11
12 mysql_query(
"UPDATE booking SET paymenttype='Delivered',deliverydate='$dt' where purchaseid='$_GET[purchaseid]'");
13 }

14 if
(isset($_SESSION[custid]))
15 {
16 $result= mysql_query(
"select * from booking where custid='$_SESSION[custid]'");
17 }

18 else

19 {
20 $result= mysql_query(
"select * from booking");
21 }
22 ?>
23         
24                             
25         <div id=
"main">
26             
27             <a name=
"TemplateInfo"></a>
28             <h1>View purchased Vehicles</h1>
29             <?php

30 if
($ctins == 1)
31 {
32     echo
"<center><b>Employees account created successfully...</b></center><br>";
33     echo
"<center><b><a href='emplogin.php'>Click here to Login.</a></b></center>";
34 }

35 else

36 {
37     ?>
38 <form id=
"form1" name="form1" method="post" action="">
39           <table width=
"754" border="1">
40             <tr>
41               <th width=
"81" scope="col">Purchase ID</th>
42               <th width=
"103" scope="col">Vehicle Name</th>
43               <th width=
"135" scope="col">Customer details</th>
44               <th width=
"92" scope="col">Date</th>
45               <th width=
"105" scope="col">Comments</th>
46               <th width=
"87" scope="col">Paid amount</th>
47               <th width=
"105" scope="col">Status</th>
48         
49               
50          
51             </tr>
52           <?php
53           
while($arrrec= mysql_fetch_array($result))
54           {
55 $result1= mysql_query(
"select * from vehiclestore where vehicleid='$arrrec[vehicleid]'");
56 $arrrec1= mysql_fetch_array($result1);
57
58 $result2= mysql_query(
"select * from customer where custid='$arrrec[custid]'");
59 $arrrec2= mysql_fetch_array($result2);
60            echo
" <tr>
61               <td>$arrrec[purchaseid]</td>
62               <td><b>Vehicle ID:</b> $arrrec1[vehicleid]<br>
63               <b>Vehicle Name:</b> $arrrec1[vehname]<br>
64               <b>Vehicle Model:</b> $arrrec1[model]</td>
65                <td><b>Customer ID:</b> </b>$arrrec2[custid]<br>
66               <b>Name: </b>$arrrec2[fname] $arrrec2[lname]<br>
67               <b>Contact No.: </b><br>$arrrec2[contactno1]<br></td>
68               <td>&nbsp;Purchase date: <br>&nbsp;$arrrec[purchasedate]&nbsp;<hr>
69               &nbsp;Delivery date: <br>&nbsp;$arrrec[deliverydate]</td>
70               <td>&nbsp; $arrrec[comments]</td>
71               <td>&nbsp; $arrrec[paid]</td>
72               <td align='center'>&nbsp; $arrrec[paymenttype]"
;
73              
if(isset($_SESSION[empid]))
74              {
75               
if($arrrec[paymenttype]=="Pending")
76               {
77
78                    echo
"<br><a href='viewbuyvehicles.php?purchaseid=$arrrec[purchaseid]'><strong>Paid</strong></a>";
79               }
80              }
81              echo
" </td>
82             </tr>"
;
83           }
84           ?>
85           </table>
86         </form>
87     <?php
88     }
89     ?>
90             <p>&nbsp;</p>
91 <br />
92                                             
93         </div>
94         
95 <!-- wrap ends here -->
96 </div>
97         
98 <?php
99 include(
"footer.php");
100 ?>


Gõ tìm kiếm nhanh...